{-# OPTIONS_GHC -fth -fglasgow-exts #-}
{-
    Projections work only on tuples that do not contain the same type twice.
    Tuple size limit for projections is 12.

    it = (1::Int, 1.0::Float, 'c', "s")
    
    project it  :: Char                             -- 'c'
    project it  :: (Char,Int)                       -- ('c',1)
    project it  :: (Float,(Char,Int))               -- (1.0,('c',1))
    project it  :: (Char,String,Float,Int)          -- ('c',"s",1.0,1)
    project [it]:: [(Float,(Int,(String,Char)))]    -- [(1.0,(1,("s",'c')))]
-}
module Data.Tuple.Projection where

import Data.Tuple.Projection.Internal

class Projection a b where
    project :: a -> b

instance (Projection a b) => Projection [a] [b] where project = map project

$(projectionsUpToDim        12)
$(expandProjectionsUpToDim  12)

